package com.alibaba.aliper.util;

import java.util.Calendar;

public class Dater {
	private static Calendar calendar = Calendar.getInstance();
	public static synchronized String getCNTime(long time){
		calendar.setTimeInMillis(time);
		StringBuffer buffer = new StringBuffer();
		int year = calendar.get(Calendar.YEAR);
		int month = calendar.get(Calendar.MONTH) + 1;
		int day = calendar.get(Calendar.DAY_OF_MONTH);
		int hour = calendar.get(Calendar.HOUR_OF_DAY);
		int min = calendar.get(Calendar.MINUTE);
		int sec = calendar.get(Calendar.SECOND);
		int mil = calendar.get(Calendar.MILLISECOND);
		buffer.append(year).append("-").append(month).append("-").append(day).append(" ").append(hour).append(":").append(min).append(":").append(sec).append(".").append(mil);
		return buffer.toString();
	}
}
